mcN = "letter"; pi = 3.1416; startRadian = startAngle * pi / 180; finalRadian = finalAngle * pi / 180; xOffset = a * Math.cos(finalRadian); yOffset = b * Math.sin(finalRadian); xscaleInc = Math.floor((100 - xscale) / increments); yscaleInc = Math.floor((100 - yscale) / increments); alphaInc = Math.floor((100 - alpha) / increments); radianInc = (finalRadian - startRadian) / increments; tiltInc = -tilt / increments; aLetters = new Array(); for (i = 0; i< numChar; i++){ aLetters[i+0] = i; var letter = this[mcN +i]; letter._visible = false; letter.init = letterInit; letter.doEffect = effect; letter.number = i; } function letterInit(){ this._visible = true; this.step = 0; this.increments = this._parent.increments; this.xscaleInc = this._parent.xscaleInc; this.yscaleInc = this._parent.yscaleInc; this._xscale = this._parent.xscale; this._yscale = this._parent.yscale; this._alpha = this._parent.alpha; this.alphaInc = this._parent.alphaInc; this.a = this._parent.a; this.b = this._parent.b; this.xFinal = this._x; this.yFinal = this._y; this.xOffset = this._parent.xOffset; this.yOffset = this._parent.yOffset; this._x = this._x - this.xOffset; this._y = this._y + this.yOffset; this.radianInc = this._parent.radianInc; this.radian = this._parent.startRadian; this.tiltInc = this._parent.tiltInc; this._rotation = this._parent.tilt; } function effect(){ this._xscale += this.xscaleInc; this._yscale += this.yscaleInc; this._alpha += this.alphaInc; this._rotation += this.tiltInc; this.radian += this.radianInc; xDist = a * Math.cos(this.radian); yDist = b * Math.sin(this.radian); this._x = this.xFinal + xDist - this.xOffset; this._y = this.yFinal - yDist + this.yOffset; this.step += 1; if (this.step >= this.increments){ this._xscale = 100; this._yscale = 100; this._alpha = 100; this._x = this.xFinal; this._y = this.yFinal; this._rotation = 0; this.gotoAndStop("end"); } } function shuffle(){ return Math.floor(Math.random() * 3) -1; } if (random == 1){ aLetters.sort(shuffle); } if (reverse == 1){ aLetters.reverse(); }